package io.renren.modules.work.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.work.dao.ScQuotationDao;
import io.renren.modules.work.entity.ScQuotationEntity;
import io.renren.modules.work.service.ScQuotationService;


@Service("scQuotationService")
public class ScQuotationServiceImpl extends ServiceImpl<ScQuotationDao, ScQuotationEntity> implements ScQuotationService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        ScQuotationEntity scQuotationEntity = new ScQuotationEntity();
        scQuotationEntity.setProjectdtlid(StringUtils.isBlank((String) params.get("projectdtlid"))?"":(String) params.get("projectdtlid"));
        IPage<ScQuotationEntity> page = this.page(
                new Query<ScQuotationEntity>().getPage(params),
                new QueryWrapper<ScQuotationEntity>(scQuotationEntity)
        );

        return new PageUtils(page);
    }

}